﻿<Window 
    x:Class="WPFVDRUtility.FontDialogBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Fonts"
    Height="300"
    Width="500"
    MinHeight="300"
    MinWidth="500"
    ResizeMode="CanResizeWithGrip"
    ShowInTaskbar="False"
    WindowStartupLocation="CenterOwner" 
    FocusManager.FocusedElement="{Binding ElementName=textBox}"
    >

  <Grid>
    
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="10" />
      <ColumnDefinition />
      <ColumnDefinition Width="10" />
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="10" />
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="10" />
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="10" />
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="10" />
    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>
      <RowDefinition Height="10" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition />
      <RowDefinition Height="10" />
      <RowDefinition />
      <RowDefinition Height="10" />
    </Grid.RowDefinitions>

    <!-- Font Family -->
    <Label Grid.Column="1" Grid.Row="1">Font:</Label>
    <TextBox Name="fontFamilyTextBox" Grid.Column="1" Grid.Row="2" Text="{Binding ElementName=fontFamilyListBox,Path=SelectedItem}" TextChanged="fontFamilyTextBox_TextChanged" />
    <ListBox Name="fontFamilyListBox" Grid.Column="1" Grid.Row="3" SelectedIndex="0" />

    <!-- Font Style -->
    <Label Grid.Column="3" Grid.Row="1">Style:</Label>
    <TextBox Name="fontStyleTextBox" Grid.Column="3" Grid.Row="2" Text="{Binding ElementName=fontStyleListBox,Path=SelectedItem}" TextChanged="fontStyleTextBox_TextChanged" />
    <ListBox Name="fontStyleListBox" Grid.Column="3" Grid.Row="3" Padding="0,0,5,0" SelectedIndex="0" />

    <!-- Font Weight -->
    <Label Grid.Column="5" Grid.Row="1">Weight:</Label>
    <TextBox Name="fontWeightTextBox" Grid.Column="5" Grid.Row="2" Text="{Binding ElementName=fontWeightListBox,Path=SelectedItem}" TextChanged="fontWeightTextBox_TextChanged" />
    <ListBox Name="fontWeightListBox" Grid.Column="5" Grid.Row="3" Padding="0,0,5,0" SelectedIndex="0" />

    <!-- Font Size -->
    <Label Grid.Column="7" Grid.Row="1">Size:</Label>
    <TextBox Name="fontSizeTextBox" Grid.Column="7" Grid.Row="2" Text="{Binding ElementName=fontSizeListBox,Path=SelectedItem}" TextChanged="fontSizeTextBox_TextChanged" />
    <ListBox Name="fontSizeListBox" Grid.Column="7" Grid.Row="3" Width="60" SelectedIndex="0" />

    <!-- Preview -->
    <GroupBox Grid.Column="1" Grid.ColumnSpan="7" Grid.Row="5" Header="Preview">
      <TextBlock TextAlignment="Center" VerticalAlignment="Center"
        FontStyle="{Binding ElementName=fontStyleListBox,Path=SelectedItem}"
        FontWeight="{Binding ElementName=fontWeightListBox,Path=SelectedItem}"
        FontSize="{Binding ElementName=fontSizeListBox,Path=SelectedItem}"
        FontFamily="{Binding ElementName=fontFamilyListBox,Path=SelectedItem}">
        The quick brown fox jumped over the lazy old brown dog.
      </TextBlock>
    </GroupBox>

    <!-- Accept or Cancel -->
    <StackPanel Grid.Column="9" Grid.Row="2" Grid.RowSpan="3">
      <Button Height="25" Width="70" Name="okButton" Click="okButton_Click" Margin="0,0,0,5" IsDefault="True">OK</Button>
      <Button Height="25" Width="70" Name="cancelButton" IsCancel="True">Cancel</Button>
    </StackPanel>

  </Grid >

</Window>
